import {readText} from "@tauri-apps/api/clipboard";

/**
 * 复制到剪贴板
 * @param value
 */
export function copy_to_clipboard(value: string): void {
    navigator.clipboard.writeText(value).finally(() => {
        window.Message.success('复制成功')
    })
}

/**
 * 从剪贴板读取内容
 */
export async function read_from_clipboard(): Promise<string> {
    return (await readText()) as string
}
